package com.superatom.concurrent.basic.executor.exception;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExceptionThread implements Runnable{

    // 在ExceptionThread任务中模拟抛出一个运行时异常
    public void run() {
        throw new RuntimeException();
    }

    public static void main(String[] args) {
        ExecutorService exec = Executors.newCachedThreadPool();
        // 异常会传播到run()方法外面
        exec.execute(new ExceptionThread());
    }
}
